package com.easybuilder.core.dictionary.controller;

import com.easybuilder.common.base.controller.BaseController;
import com.easybuilder.core.dictionary.service.DictionaryService;
import com.easybuilder.core.dictionary.view.DictionaryView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ZXS
 * @version 1.0
 * @description 类
 * @date 2021-8-29 17:11
 */
@RestController
@RequestMapping("/sys/dictionary")
public class DictionaryController extends BaseController {
    @Autowired
    private DictionaryService dictionaryService;

    @GetMapping("/view/{dict_id}")
    public Result<Object> getDictionaryView(@PathVariable(name = "dict_id", required = true) Long dict_id) {
        List<DictionaryView> view = dictionaryService.getDictionaryView(dict_id);
        return OK(view);
    }
}
